package com.healthySys.backend;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.healthySys.backend.mapper.UserFullInfoVOMapper;
import com.healthySys.common.entity.UserFullInfoVO;
import com.healthySys.common.utils.UserContextUtil;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Map;

@SpringBootTest
class HealthySysApplicationTest {

    @Resource
    UserFullInfoVOMapper userFullInfoVOMapper;
    @Resource
    UserContextUtil userContextUtil;

    @Test
    public void test(){
        String username="admin";
        QueryWrapper<UserFullInfoVO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",username);
        UserFullInfoVO userFullInfoVO = userFullInfoVOMapper.selectOne(queryWrapper);
        System.out.println(userFullInfoVO);
        System.out.println(userFullInfoVO.getAuthorities());

    }

    @Test
    public void test2(){
        Map<String, String> aLlSecurityContext = userContextUtil.getALlSecurityContext();
        System.out.println(aLlSecurityContext);
    }

}